package com.zpark.express.mapper;

import com.zpark.express.domain.Admin;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface AdminMapper {

    @Select("select * from admin where admin_name=#{adminName} and admin_pwd=#{adminPwd}")
    Admin findByNameAndPwd(Admin admin);

    @Select("select * from admin")
    List<Admin> findAll();

    int updateByAdminId(Admin admin);

    @Select("select * from admin where admin_id=#{adminId}")
    Admin findById(Integer adminId);

    @Delete("delete from admin where admin_id=#{adminId}")
    int deleteById(int adminId);
}
